A Semantics for Approximate Program Transformations
نویسندگان
چکیده
An approximate program transformation is a transformation that can change the semantics of a program within a specified empirical error bound. Such transformations have wide applications: they can decrease computation time, power consumption, and memory usage, and can, in some cases, allow implementations of incomputable operations. Correctness proofs of approximate program transformations are by definition quantitative. Unfortunately, unlike with standard program transformations, there is as of yet no modular way to prove correctness of an approximate transformation itself. Error bounds must be proved for each transformed program individually, and must be reproved each time a program is modified or a different set of approximations are applied. In this paper, we give a semantics that enables quantitative reasoning about a large class of approximate program transformations in a local, composable way. Our semantics is based on a notion of distance between programs that defines what it means for an approximate transformation to be correct up to an error bound. The key insight is that distances between programs cannot in general be formulated in terms of metric spaces and real numbers. Instead, our semantics admits natural notions of distance for each type construct; for example, numbers are used as distances for numerical data, functions are used as distances for functional data, and polymorphic lambda-terms are used as distances for polymorphic data. We then show how our semantics applies to two example approximations: replacing reals with floatingpoint numbers, and loop perforation.
منابع مشابه
Approximate Transformations as Mutation Operators
Mutation testing is a well-established approach for evaluating test-suite quality by modifying code using syntaxchanging (and potentially semantics-changing) transformations, called mutation operators. This paper proposes approximate transformations as new mutation operators that can give novel insights about the code and tests. Approximate transformations are semantics-changing transformations...
متن کاملAccuracy-Aware Program Transformations
Program approximation has been accepted as a necessary and useful technique for solving time-consuming computational problems since the inception of computer science. However, for a long time it has been treated exclusively as an algorithmic problem – a domain expert, computer scientist, or a developer has been responsible for proposing, implementing, and evaluating approximate algorithms. Up t...
متن کاملType Analysis for CHIP
This paper proposes a tool to support reasoning about (partial) correctness of constraint logic programs. The tool infers a speciica-tion that approximates the semantics of a given program. The semantics of interest is an operational \call-success" semantics. The main intended application is program debugging. We consider a restricted class of spec-iications, which are regular types of constrai...
متن کاملBuilding blocks for exact and approximate inference
A promising approach to implementing black-box inference is to search a space of inference strategies. However, a search space has not been defined to date that includes combinations of exact and approximate inference methods, such as Rao-Blackwellized Metropolis-Hastings and Gibbs sampling of continuous distributions. We present a handful of inference building blocks that not only constitute b...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1304.5531 شماره
صفحات -
تاریخ انتشار 2013